package com.YYGH.exceltest;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;

import java.util.Map;

public class ExcelListener extends AnalysisEventListener<Employee> {
    //没解析一条数据都会来调用invoke().读取表头数据
    @Override
    public void invoke(Employee data, AnalysisContext context) {
        System.out.println(data);
    }

    //读取表头数据
    @Override
    public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {
        super.invokeHeadMap(headMap, context);
        System.out.println("表头信息"+headMap);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext context) {
      System.out.println("读取完成");
    }
}
